/**
 * @date 2005-12-12 9:41:04
 *
 */
package org.nanhill.commons.model.table;

/**
 * @author alin
 * 
 */
public class Cell {
	private int colspan;

	private int rowspan;

	private int styleId;

	private String value;

	public int getRowspan() {
		return rowspan;
	}

	public void setRowspan(int rowspan) {
		if (0 > rowspan)
			throw new IllegalArgumentException(
					"rowspan must be unsigned integer.");
		this.rowspan = rowspan;
	}

	public int getColspan() {
		return colspan;
	}

	public void setColspan(int colspan) {
		if (0 > colspan)
			throw new IllegalArgumentException(
					"colspan must be unsigned integer.");
		this.colspan = colspan;
	}

	public void setSpans(int rowspan, int colspan) {
		this.setColspan(colspan);
		this.setRowspan(rowspan);
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public Cell(String value) {
		this();
		this.value = value;

	}

	public Cell() {
		this.colspan = 1;
		this.rowspan = 1;
	}

	public int getStyleId() {
		return styleId;
	}

	public void setStyleId(int classId) {
		this.styleId = classId;
	}

}
